<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
  <title>地图热点</title>
  <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
  <style>
    html,body{
      width: 100%;
      height: 100%;
      margin: 0px;
    }
    .map{
      height: 100%;
      width: 100%;
      float: left;
    }
    .info-title{
      font-weight: bolder;
      color: #000;
      font-size: 14px;
      width: 250px;
      line-height: 26px;
      padding: 0 0 0 6px;
    }
    .info-content{
      width: 250px;
      padding: 4px;
      color: #666666;
      line-height: 23px;
      font: 12px Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial;
    }
    .info-content img{
      float: left;
      margin: 3px;
    }
    .amap-info-combo .keyword-input {
      height: auto;
    }
    /*取消logo*/
    .BMap_cpyCtrl
    {
      display: none;
    }
    .anchorBL {
      display: none;
    }
    .amap-logo img{
      display: none;
    }
    .amap-copyright {
      opacity:0;
    }
  </style>
  <script src="https://webapi.amap.com/maps?v=2.0&key=53b4e246765e8898dc8ecfa7f7a543e5&plugin=AMap.PlaceSearch,AMap.InfoWindow"></script>
  <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
</head>
<body>
<div id="container" class="map"></div>
<script>
  var map = new AMap.Map('container', {
    resizeEnable: true,
    center:[113.53591,34.817077], // 郑州大学
    zoom: 16,
    isHotspot: true
  });
  var placeSearch = new AMap.PlaceSearch();  //构造地点查询类
  var infoWindow=new AMap.InfoWindow({});
  map.on('hotspotover', function(result) {
    placeSearch.getDetails(result.id, function(status, result) {
      if (status === 'complete' && result.info === 'OK') {
        placeSearch_CallBack(result);
      }
    });
  });
  //回调函数
  function placeSearch_CallBack(data) { //infoWindow.open(map, result.lnglat);
    var poiArr = data.poiList.pois;
    var location = poiArr[0].location;
    infoWindow.setContent(createContent(poiArr[0]));
    infoWindow.open(map,location);
  }
  function createContent(poi) {  //信息窗体内容
    var s = [];
    s.push('<div class="info-title">'+poi.name+'</div><div class="info-content">'+"地址：" + poi.address);
    s.push("电话：" + poi.tel);
    s.push("类型：" + poi.type);
    s.push('<div>');
    return s.join("<br>");
  }
</script>
</body>
</html>